import React, { ReactElement, ReactNode, Fragment } from 'react'
import styles from '@/pages/index.less'
import { Input } from 'antd'
import { connect } from 'umi'

interface Props {
    type: string,
    changeHeroInfo: Function
}

function Index({ type, changeHeroInfo }: Props): ReactElement {
    return (
        <Fragment>
            <Input onChange={(ev) => {
                changeHeroInfo(type, ev.target.value)
            }} />
        </Fragment>
    )
}

export default connect(() => {
    return {

    }
}, (dispatch) => {
    return {
        changeHeroInfo(classify: string, value: string) {
            dispatch({ type: "hero/changeHeroInfo", classify, value })
        }
    }
})(Index)

